<!-- 已参与 -->

<script setup lang="ts">
import ApiActivity from "@/api/activity";
import BySpin from "@/components/ui/BySpin.vue";
import ActivitiCardForMerchant from "./ActivitiCardForMerchant.vue";

import useList from "@/hooks/useList";

import { TActivity, TActivityApply } from "@/global";

defineProps<{
  merchant?: number;
}>();

const { list, loading } = useList<TActivity & TActivityApply>(
  ApiActivity.getApplyActivityList,
);
</script>

<template>
  <ActivitiCardForMerchant v-for="item in list"
                           :key="item.id"
                           :merchant="merchant"
                           :source="item"
                           applied
                           class="mb-3" />

  <BySpin v-if="loading" />
</template>
